package com.chen.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.chen.entity.ExamPaper;
import com.chen.mapper.ExamMapper;
import com.chen.mapper.ExamPaperMapper;
import com.chen.service.IExamPaperService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author personcoder007
 * @since 2022-08-17
 */
@Service
public class ExamPaperServiceImpl extends ServiceImpl<ExamPaperMapper, ExamPaper> implements IExamPaperService {


    @Autowired
    private ExamPaperMapper examPaperMapper;

    @Transactional
    @Override
    public void addPapaer(ExamPaper paper) {
        remove(new UpdateWrapper<ExamPaper>().eq("exam_id",paper.getExamId()));
        save(paper);
    }
}
